package com.bw.liuyushan.zhuangao4_mvptest1.MVP.View.Activity;

import android.content.Intent;

import com.blankj.utilcode.util.ToastUtils;
import com.bw.liuyushan.mvp_lib.View.BaseActivity;
import com.bw.liuyushan.zhuangao4_mvptest1.Entity.ViedoBean;
import com.bw.liuyushan.zhuangao4_mvptest1.MVP.Contrack.ICTest;
import com.bw.liuyushan.zhuangao4_mvptest1.MVP.Model.BaseModelTest;
import com.bw.liuyushan.zhuangao4_mvptest1.MVP.Presenter.BasePresenterTest;
import com.bw.liuyushan.zhuangao4_mvptest1.R;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

import java.io.Serializable;
import java.util.List;

/**
 * ZhuanGao4_MVPTest1
 * file name is : GSYItemActivity
 * created by Ender on 2021/8/17 15:02.
 * author : Liuyushan
 * Describe(作用):TabFragment快手布局点击跳转的视频详情Activity 接收对象 显示 播放视频
 */
public class GSYItemActivity extends BaseActivity<BasePresenterTest> implements ICTest.C_ViewTest{
    private com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer stand;

    @Override
    public int bindLayout() {
        return R.layout.activity_gsyitem;
    }

    @Override
    public void initView() {
        //防止内存泄露
        ip = new BasePresenterTest(new BaseModelTest(), this);

        stand = (StandardGSYVideoPlayer) findViewById(R.id.stand);
    }

    @Override
    public void initDate() {
        //接受 序列化对象
        Intent intent = getIntent();
        ViedoBean.DataBean objectV = (ViedoBean.DataBean) intent.getSerializableExtra("objectV");
        stand.setUp(objectV.getVideopath(),false,objectV.getCaption());
        stand.startPlayLogic();
        ToastUtils.showShort("视频发布时间:"+objectV.getPublishtime());

    }
}
